using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Exchange_order_RoutinginfoMap : EntityTypeConfiguration<Exchange_order_Routinginfo>
    {
        public Exchange_order_RoutinginfoMap()
        {
            // Primary Key
            this.HasKey(t => t.XOID);

            // Properties
            this.Property(t => t.XOID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Class)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.Status)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.Carrier)
                .HasMaxLength(6);

            this.Property(t => t.Departure_time)
                .HasMaxLength(10);

            this.Property(t => t.Reference)
                .HasMaxLength(8);

            this.Property(t => t.Fare_basis)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Exchange_order_Routinginfo");
            this.Property(t => t.XOID).HasColumnName("XOID");
            this.Property(t => t.Flight_nb).HasColumnName("Flight_nb");
            this.Property(t => t.Class).HasColumnName("Class");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Carrier).HasColumnName("Carrier");
            this.Property(t => t.Departure_date).HasColumnName("Departure_date");
            this.Property(t => t.Departure_time).HasColumnName("Departure_time");
            this.Property(t => t.source).HasColumnName("source");
            this.Property(t => t.Destination).HasColumnName("Destination");
            this.Property(t => t.kind).HasColumnName("kind");
            this.Property(t => t.Reference).HasColumnName("Reference");
            this.Property(t => t.Fare_basis).HasColumnName("Fare_basis");
        }
    }
}
